package com.example.behaviorpattern.state.impl;


import com.example.behaviorpattern.state.MusicPlayer;
import com.example.behaviorpattern.state.PlayerState;


/**
 * 具体状态类：停止状态
 *
 * @author yaojianfeng
 */
public class StoppedState implements PlayerState {
    @Override
    public void play(MusicPlayer context) {
        System.out.println("开始播放音乐。");
        context.setState(new PlayingState());
    }

    @Override
    public void stop(MusicPlayer context) {
        System.out.println("音乐已经停止了。");
    }

    @Override
    public void pause(MusicPlayer context) {
        System.out.println("无法从停止状态暂停音乐。");
    }
}